import Vue from 'vue';
import Router from 'vue-router';
import Home from '@/pages/home/Home';
import Vip from '@/pages/vip/Vip';
import Search from '@/pages/search/Search';
import ShopCart from '@/pages/shop-cart/ShopCart';
import NewsList from '@/components/home/news/NewsList';
import NewsDetail from '@/components/home/news/NewsDetail';
import ImagesList from '@/components/home/images-share/ImagesList';
import ImagesDetail from '@/components/home/images-share/ImagesDetail';
import GoodsList from '@/components/home/goods/GoodsList';

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: '/',
      redirect: { name: 'home' },
    },
    {
      path: '/home',
      name: 'home',
      component: Home,
      meta: { title: '首页' },
    },
    {
      path: '/search',
      name: 'search',
      component: Search,
      meta: { title: '搜索' },
    },
    {
      path: '/shopCart',
      name: 'shopCart',
      component: ShopCart,
      meta: { title: '购物车' },
    },
    {
      path: '/vip',
      name: 'vip',
      component: Vip,
      meta: { title: '会员' },
    },
    {
      path: '/news/list',
      name: 'newsList',
      component: NewsList,
      meta: { title: '新文列表' },
    },
    {
      path: '/news/detail',
      name: 'newsDetail',
      component: NewsDetail,
      meta: { title: '新闻详情' },
    },
    {
      path: '/images/list',
      name: 'imagesList',
      component: ImagesList,
      meta: { title: '图文列表' },
    },
    {
      name: 'imagesDetail',
      path: '/images/detail',
      component: ImagesDetail,
      meta: { title: '图文详情' },
    },
    {
      name: 'goodsList',
      path: '/goods/list',
      component: GoodsList,
      meta: { title: '商品列表' },
    },
  ],
});
